#include "config/SkUserConfig.h"
#include "include/effects/SkLumaColorFilter.h"
#include "oh/DrawingHash.h"
#include "SkLumaColorFilterOHOS.h"

#include <native_drawing/drawing_color_filter.h>

SkLumaColorFilterOHOS::SkLumaColorFilterOHOS() {
    fOHColorFilter = OH_Drawing_ColorFilterCreateLuma();
    DrawingHash hasher;
    hasher.push(HASH_UNIQUE_ID);
    fHash = hasher.digest();
}

SkLumaColorFilterOHOS::~SkLumaColorFilterOHOS() {
    OH_Drawing_ColorFilterDestroy(fOHColorFilter);
}


bool SkLumaColorFilterOHOS::appendStages(const SkStageRec& rec, bool) const {
    RENDER_UNIMPLEMENTED;
    return false;
}

SkPMColor4f SkLumaColorFilterOHOS::onFilterColor4f(const SkPMColor4f& color, SkColorSpace* dstCS) const {
    RENDER_UNIMPLEMENTED;
    return SK_PMColor4fWHITE;
}

void SkLumaColorFilterOHOS::flatten(SkWriteBuffer& buffer) const {
    return;
}

sk_sp<SkFlattenable> SkLumaColorFilterOHOS::CreateProc(SkReadBuffer& buffer) {
    return SkLumaColorFilter::Make();
}

sk_sp<SkColorFilter> SkLumaColorFilter::Make() {
    return sk_sp<SkColorFilter>(new SkLumaColorFilterOHOS());;
}